home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / include / user / sprite.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-12  |  2.4 KB  |  106 lines

  1. /*
  2.  * sprite.h --
  3.  *
  4.  * Common constants and type declarations for Sprite.
  5.  *
  6.  * Copyright 1985, 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/sprite.h,v 1.3 92/05/12 11:54:30 kupfer Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _SPRITE
  19. #define _SPRITE
  20.  
  21. #include "cfuncproto.h"
  22. /*
  23.  * A boolean type is defined as an integer, not an enum. This allows a
  24.  * boolean argument to be an expression that isn't strictly 0 or 1 valued.
  25.  */
  26.  
  27. #ifndef TRUE
  28. #define TRUE    1
  29. #endif
  30. #ifndef FALSE
  31. #define FALSE    0
  32. #endif
  33.  
  34. #ifndef _ASM
  35. typedef int Boolean;
  36.  
  37. /*
  38.  * Functions that must return a status can return a ReturnStatus to
  39.  * indicate success or type of failure.
  40.  */
  41.  
  42. typedef int  ReturnStatus;
  43. #endif /* _ASM */
  44.  
  45. /*
  46.  * The following statuses overlap with the first 2 generic statuses 
  47.  * defined in status.h:
  48.  *
  49.  * SUCCESS            There was no error.
  50.  * FAILURE            There was a general error.
  51.  */
  52.  
  53. #define    SUCCESS            0x00000000
  54. #define    FAILURE            0x00000001
  55.  
  56.  
  57. /*
  58.  * A nil pointer must be something that will cause an exception if
  59.  * referenced.  In native Sprite there are two nils: the kernel's nil
  60.  * and the nil used by user processes.  In the Sprite server these two
  61.  * are the same.  
  62.  * XXX Unfortunately, there's some user code that knows about NIL and knows 
  63.  * that it's set to -1.  Maybe it would be better to make NIL -1 for the 
  64.  * server, too.
  65.  */
  66.  
  67. #ifdef SPRITED
  68. #define NIL         0
  69. #else
  70. #define NIL        0xFFFFFFFF
  71. #endif
  72. #define USER_NIL     0
  73. #ifndef NULL
  74. #define NULL         0
  75. #endif
  76.  
  77. #ifndef _ASM
  78. /*
  79.  * An address is just a pointer in C.  It is defined as a character pointer
  80.  * so that address arithmetic will work properly, a byte at a time.
  81.  */
  82.  
  83. typedef char *Address;
  84.  
  85. /*
  86.  * ClientData is an uninterpreted word.  It is defined as an int so that
  87.  * kdbx will not interpret client data as a string.  Unlike an "Address",
  88.  * client data will generally not be used in arithmetic.
  89.  */
  90.  
  91. #ifndef _CLIENTDATA
  92. typedef int *ClientData;
  93. #define _CLIENTDATA
  94. #endif
  95.  
  96. #ifndef __STDC__
  97. #define volatile
  98. #define const
  99. #endif
  100.  
  101. extern void panic();
  102.  
  103. #endif /* !_ASM */
  104.  
  105. #endif /* _SPRITE */
  106.